package org.example.gateway.config.properties;

import lombok.Data;

import java.util.HashMap;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ConcurrentMap;

/**
 * 资源鉴权名单配置
 */
@Data
public class AccessManagerProperties {
    /**
     * 需要验证资源名单配置，网关校验此处的资源名单
     */
    private ConcurrentMap<String,AccessProperties> resource=new ConcurrentHashMap<>();

    public AccessManagerProperties(AccessRoutesProperties routesProperties){
        routesProperties.getRoutes().forEach(r->{
            resource.put(r.getId(),r);
        });
    }




}
